<template>
  <el-dialog
    title="提示"
    :visible.sync="dialogVisible"
    width="500px"
    :before-close="handleClose"
  >
    <div class="mb20">操作成功！上传商品数：<b>{{ quantity.succeededNum }}</b> ，发往供应商端确认商品数：<b>{{ quantity.sendSupplierNum }}</b>。</div>
    <div v-if="quantity.succeededNum"><b>{{ quantity.succeededNum }}</b> 个商品发起线下建品成功，鲜食成对商品请等待供应商处理，其他商品请数据校验菜单<el-button type="text" @click="goOffline">继续线下建品</el-button></div>
    <div v-if="quantity.sendOnlineNum"><b>{{ quantity.sendOnlineNum }}</b> 个商品发起线上建品成功，请到线上管理 - 线上建品任务菜单<el-button type="text" @click="goOnline">继续线上建品</el-button></div>
  </el-dialog>
</template>

<script>
import { scheduleListID } from '@/views/coi/commonJs/tableHeadList.js'

export default {
  name: 'SuccessDialog',
  data() {
    return {
      dialogVisible: false,
      quantity: {
        succeededNum: 0, // 上传成功总数，
        sendOnlineNum: 0, // 线上数量
        sendOfflineNum: 0, // 线下数量
        sendSupplierNum: 0// 发往供应商数量
      }
    }
  },
  methods: {
    handleClose() {
      this.dialogVisible = false
      this.$parent.toQuery()
    },
    goOffline() {
      this.handleClose()
    },
    goOnline() {
      this.handleClose()
      this.$router.push({
        name: 'ScheduleList',
        params: {
          tab: 'scheduleList',
          type: scheduleListID.processingTasks
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
/deep/ .el-dialog__body{
  padding: 10px 20px;
}
div{
  line-height: 16px;
}
.mb20{
  margin-bottom: 20px;
}
</style>>

